import { $Http } from '@/config/service/http';
import { HOST } from '@/config';

export enum Api {
  getTypeTreeData = '/system/dict/type/treeData', //数据字典树形菜单
  infoImportDictInfo = '/system/dict/info/importDictInfo', //字典导入
  updateParentIdAndSortNo = '/system/dict/type/updateParentIdAndSortNo', //修改类型的父级和排序
  rulePage = '/system/sequence/rule/page', // 编码规则分页查询
  orgTreeData = '/system/org/treeData', // 机构树
  orgTreeDataSubject = '/system/org/treeDataSubject', // 查询机构树以及用户
  subjectPage = '/system/subject/page', // 用户列表
  subjectListSimple = '/system/subject/listSimple', // 用户列表-简单
  listByTypeKey = '/system/dict/info/listByTypeKey', // 根据字典类型key获取字典列表
  findSubjectSeal = '/pdm/seal/findSubjectSeal' // 验证用户后，获取用户个人印章地址
}

/**
 * 数据字典树形菜单
 * @param params
 */
export const getTypeTreeData = (params) => {
  return $Http.api(Api.getTypeTreeData, params, 'post');
};

/**
 * 字典导入
 * @param params
 */
export const infoImportDictInfo = (params) => {
  return $Http.api(Api.infoImportDictInfo, params, 'post');
};

/**
 * 修改类型的父级和排序
 * @param params
 */
export const updateParentIdAndSortNo = (params) => {
  return $Http.api(Api.updateParentIdAndSortNo, params, 'post');
};

/**
 * 根据字典类型key获取字典列表
 * @param params
 */
export const listByTypeKey = (params) => {
  return $Http.api(Api.listByTypeKey, params, 'post');
};

/**
 * 验证用户后，获取用户个人印章地址
 * @param params
 */
export const findSubjectSeal = (params) => {
  return $Http.api(Api.findSubjectSeal, params, 'post');
};

export const subjectListSimple = (params) => {
  return $Http.api(Api.subjectListSimple, params, 'post');
};

export const orgTreeDataSubject = (params) => {
  return $Http.api(Api.orgTreeDataSubject, params, 'post');
};

/**
 * 查询机构树
 * @param params
 */
export const orgTreeData = (params) => {
  return $Http.api(Api.orgTreeData, params, 'post');
};
